Skip to main content

GetNext

Returns the next paragraph.

Syntax

expression.GetNext();

expression - A variable that represents a ApiParagraph class.

Parameters

This method doesn't have any parameters.

Returns

ApiParagraph | null

Example

This example shows how to get the next paragraph.

let doc = Api.GetDocument();
let paragraph1 = doc.GetElement(0);
paragraph1.AddText("This is just a sample paragraph №1.");
let paragraph2 = Api.CreateParagraph();
paragraph2.AddText("This is just a sample paragraph №2.");
doc.Push(paragraph2);
let nextParagraph = paragraph1.GetNext();
nextParagraph.SetBold(true);